home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / phit.swf / scripts / __Packages / FreshFramework.as < prev    next >
Encoding:
Text File  |  2007-07-13  |  1.8 KB  |  69 lines

  1. class FreshFramework
  2. {
  3.    static var _simulation;
  4.    static var m_isRunningLocally = true;
  5.    static var m_isRunningLocalRemoteDebug = false;
  6.    function FreshFramework()
  7.    {
  8.    }
  9.    static function get _isRunningLocally()
  10.    {
  11.       return FreshFramework.m_isRunningLocally;
  12.    }
  13.    static function set _isRunningLocally(isRunningLocally)
  14.    {
  15.       FreshFramework.m_isRunningLocally = isRunningLocally;
  16.    }
  17.    static function get _isRunningLocalRemoteDebug()
  18.    {
  19.       return FreshFramework.m_isRunningLocalRemoteDebug;
  20.    }
  21.    static function set _isRunningLocalRemoteDebug(isRunningLocalRemoteDebug)
  22.    {
  23.       FreshFramework.m_isRunningLocalRemoteDebug = isRunningLocalRemoteDebug;
  24.    }
  25.    static function get _serverURL()
  26.    {
  27.       if(FreshFramework.m_isRunningLocalRemoteDebug)
  28.       {
  29.          return "http://www.jeffwofford.com/";
  30.       }
  31.       if(FreshFramework.m_isRunningLocally)
  32.       {
  33.          return "http://localhost/";
  34.       }
  35.       return "/";
  36.    }
  37.    static function IsOnValidDomain()
  38.    {
  39.       return FreshFramework._isRunningLocally || FreshFramework._isRunningLocalRemoteDebug || _root._url.indexOf("http://www.jeffwofford.com") == 0;
  40.    }
  41.    static function get _doesSimulationExist()
  42.    {
  43.       return !!_root._simulation;
  44.    }
  45.    static function get _simulation()
  46.    {
  47.       if(_root._simulation)
  48.       {
  49.       }
  50.       return _root._simulation;
  51.    }
  52.    static function Initialize(doCreateIfAbsent)
  53.    {
  54.       if(!_root._simulation && doCreateIfAbsent)
  55.       {
  56.          _root._simulation = new CSimulation();
  57.       }
  58.    }
  59.    static function Shutdown()
  60.    {
  61.       delete _root._simulation;
  62.       _root._simulation = null;
  63.    }
  64.    static function Update()
  65.    {
  66.       _root._simulation.Update();
  67.    }
  68. }
  69.